<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    {block name="title_seo"}{/block}
    <script src="/static/admin/js/jquery-2.0.0.min.js"></script>
    <link rel="stylesheet" href="/static/admin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/index/css/style.css" media="all">
    {block name="css"}{/block}
</head>
<body class="bg">
<div class="header">
    <div class="layui-container header-box">
        <div class="logo">
            <a href="/">
                <img src="{~echo xn_cfg('base.logo')}" alt="">
            </a>
        </div>
        <div class="menu-box">
            <div class="menu">
                <ul>
                    <li {if condition="$controller eq 'index'"} class="active"{/if}><a href="/">首页</a></li>
                </ul>
            </div>
            <div class="user">
                {if condition="$user.id gt 0"}
                <a href="{:url('user/index')}" class="user-dropdown-on" lay-options="{trigger: 'hover'}">
                    <img src="{$user.avatar|default='/static/index/images/avatar.png'}" class="avatar">
                </a>
                {else/}
                <a href="{:url('login/login')}" class="xn_open" data-width="380px" data-height="370px" data-auto="1" title="登录">登录</a> /
                <a href="{:url('login/register')}" class="xn_open" data-width="380px" data-auto="1" title="注册">注册</a>
                {/if}
            </div>
        </div>
    </div>
</div>

{block name="body"}
{/block}

<div class="footer">
    <div class="layui-container">
        ©2024 xnadmin.cn
    </div>
</div>

<script src="/static/admin/layui/layui.js"></script>
<script src="/static/index/js/index.js"></script>
<script>
    layui.use(function(){
        var dropdown = layui.dropdown;
        // 自定义事件
        dropdown.render({
            elem: '.user-dropdown-on',
            data: [{
                title: '个人中心',
                url: "{:url('user/index')}",
            },{
                title: '退出登录',
                url: "{:url('user/logout')}",
            }],
            click: function(obj){
                window.location.href = obj.url
            },
        });
    });
</script>
{block name="js"}{/block}
</body>
</html>